/*$(window).bind("load", function() { 
       
    var footerHeight = 0,
    footerTop = 0,
    $footer = $("#footer");
           
    setTimeout(positionFooter, 500);
       
    function positionFooter() {
        $footer.css('visibility', 'visible')
        footerHeight = $footer.height();
        footerTop = ($(window).scrollTop()+$(window).height()-footerHeight-30)+"px";
        if ( ($(document.body).height()) < $(window).height()) {
            $footer.css({
                position: "absolute",
                top: footerTop,
                width: "100%"
            })
        } else {
            $footer.css({
                position: "static"
            })
        }
               
    }

    $(window)
    .resize(positionFooter)
               
});*/

$(window).bind("load", function() {

var footer = $("#footer");

var pos = footer.position();

var height = $(window).height();

height = height - pos.top;

height = height - footer.height();

    if (height > 0) {

      footer.css({'margin-top' : (height+20)+'px'});

  }
});

